// 引入mongoose模块
const mongoose = require('mongoose')
// 连接本地数据库
mongoose.connect('mongodb://localhost/blog')

// 定义数据模型
const replyCommentSchema = mongoose.Schema({
  content: String,
  add_time: String,
  articleId: String,
  commentId: String,
  commentType: String,
  nickName: String
}, { collection: 'replyComments' })
// 上面第二个参数指定到数据库的replyComments表中取数据

// 导出model模块
const replyComment = module.exports = mongoose.model('replyComments', replyCommentSchema)
